Dynamic Array
Actually we use dynamic array frequently, like list
in python, vector
in c++, ArrayList/List
in Java
In fact, no such built-in array in python so that many people are confused about when they learn a new programming language.
As we know (python user prob don't) array is a collection with static size. Since we are not always know the exactly size of data so that we need Dynamic Array.
The basic idea is very simple where we assign amount of address or we say allocate amount of address, and once they're full create new one :)
insert(A, x)
: check before insert, if full, create new one and copy all of them/concatenate if use other way (such as index attribute)
implement
nothing to say, it can implement in many ways (i.e. Linked List, )